//
//  CCQConfig.swift
//  Fangxukanghan
//
//  Created by 常超群的MacBookPro on 2021/3/21.
//

import UIKit

/// 屏幕宽
public var CCQScreenWidth: CGFloat {
    UIScreen.main.bounds.width
}
/// 屏幕高
public var CCQScreenHeight: CGFloat {
    UIScreen.main.bounds.height
}
/// 状态栏高度
public var CCQStatusBarHeight: CGFloat {
    UIApplication.shared.statusBarFrame.size.height
}
/// NavBar高度
public var CCQNavBarHeight: CGFloat {
    UINavigationController().navigationBar.frame.height
}
/// 整个导航栏高度
public var CCQTopHeight: CGFloat {
    CCQStatusBarHeight + CCQNavBarHeight
}
/// 底部操作条高度
public var CCQBottomHomeBarHeight: CGFloat {
    UIWindow().safeAreaInsets.bottom
}
/// tabbar高度
public var CCQTabBarHeight: CGFloat {
    UITabBarController().tabBar.height
}

/// 获取window
public var CCQWindow: UIWindow {
    if let window = UIApplication.shared.ccq_currentWindow {
        return window
    } else {
        return UIWindow()
    }
}
// MARK: - 重命名

public typealias CCQVoidClosure = () -> Void
